package com.ssy.lingxi.purchase.api.enums.tender;

import com.ssy.lingxi.common.language.LanguageHolder;

import java.util.Arrays;

/**
 * 招标外部状态枚举类型
 * @author jw.chen
 * @version 2.0.0
 * @date 2020/6/29
 */
public enum InviteTenderOutStatusEnum {

    Submitted_Invite_Tender(1, "待提交招标"),
    /*Platform_Not_Check_Invite_Tender(2, "待平台审核招标"),22.1.20版本去掉
    Platform_Check_Not_Pass(3, "平台审核不通过"),*/
    Not_Invite_Tender_Register(4, "待招标报名"),
    Not_Check_Register_Check(5, "待审核报名"),
    Not_Submitted_Qualifications_Check(6, "待提交资格预审"),
    Not_Qualifications_Check(7, "待资格预审"),
    Not_Submit_Tender(8, "待投标"),
    Not_Open_Tender(9, "待开标"),
    Not_Selection_Tender(10, "待评标"),
    Not_Finish_Notice(11, "待定标"),
    Not_Win_Notice(12, "待中标公示"),
    Finish_Invite_Tender(13, "完成招标"),
    Discard_Tender(14, "已废标");

    private Integer code;
    private String message;

    InviteTenderOutStatusEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public static String getMessage(Integer code){
        InviteTenderOutStatusEnum statusEnum = Arrays.stream(InviteTenderOutStatusEnum.values()).filter(v -> v.getCode().equals(code)).findAny().orElse(null);
        return null == statusEnum ? "" : LanguageHolder.getName(InviteTenderOutStatusEnum.class, statusEnum.getCode());
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return LanguageHolder.getName(this.getClass(), this.code);
    }
}
